/*
 * Toedo
 * Copyright (C) 2009-2010 J. Devauchelle and contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 3 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package org.toedo.model;

import java.util.UUID;

public class Attachment {
	
	public enum AttachmentType {
		EnFile,
		EnUrl;
	}
	
	private UUID mId;
	private AttachmentType mType;
	private String mTitle;
	private String mLink;
	
	public Attachment(AttachmentType type, String title, String link) {
		mId = UUID.randomUUID();
		mType = type;
		mTitle = title;
		mLink = link;
		
		if ((mTitle == null) ||
				(mTitle.isEmpty())) {
			mTitle = mLink;
		}
	}
	
	public UUID getId() {
		return mId;
	}
	
	public AttachmentType getType() {
		return mType;
	}
	
	protected void setType(AttachmentType value) {
		mType = value;
	}
	
	public String getTitle() {
		return mTitle;
	}
	
	protected void setTitle(String value) {
		mTitle = value;
	}
	
	public String getLink() {
		return mLink;
	}
	
	protected void setLink(String value) {
		mLink = value;
	}

}
